-
-
Notifications
You must be signed in to change notification settings - Fork 112
[Minor] Units of the same type do not attack the same target #1807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
|
||
void TechnoExt::ExtData::AddFirer(WeaponTypeClass* const Weapon, TechnoClass* const Attacker) | ||
{ | ||
if (Attacker->InLimbo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why shouldn't the limbo Firestarter be recorded?
@@ -310,6 +310,11 @@ DEFINE_HOOK(0x6FC339, TechnoClass_CanFire, 0x6) | |||
|
|||
if (pTargetTechno) | |||
{ | |||
const auto pTargetExt = TechnoExt::ExtMap.Find(pTargetTechno); | |||
|
|||
if (pWeaponExt->OnlyAttacker.Get() && !pTargetExt->ContainFirer(pWeapon, pThis)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need .Get()
I think?
|
||
const auto pWeaponExt = WeaponTypeExt::ExtMap.Find(pWeapon); | ||
|
||
if (pWeaponExt->OnlyAttacker.Get() && pTarget == pThis->Target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
When a weapon has
OnlyAttacker=yes
, it prevents other units using that weapon from attacking the same target.OnlyAttacker=yes
时,它会阻止使用该武器的其他单位攻击同一目标。